#ifndef OBJMESH_H_INCLUDED
#define OBJMESH_H_INCLUDED
#include <string>
#include "File.h"
#include "ObjUsefulFunctions.h"
#include "vec2.h"
#include "TextureManager.h"
#include "Vec3.h"
#include <vector>

#undef File

class OBJMesh
{
public:
	OBJMesh();
	bool Load(const std::string &Filename);
	void Draw();
	void DrawUsingVertexArray();
	void DrawWireFrame();
	void Clear();

	Faces& ReturnFaces() {return m_faces;}
	Vecs& ReturnCoords() {return m_coords;}
	std::vector<Vec3f>&  ReturnNormalVec() {return TheNormalVec;}
	std::vector<Vec3f>& ReturnPositionVec() {return ThePositionVec;}
	void SetAnimationMesh(std::vector<Vec3f>& ModifiedMesh);

private:
	void LoadMTL(const std::string&);


private:
	std::string m_CurrentLine;
	Vecs m_coords;
	Vecs m_Normals;
	std::vector<Vec2f> m_UV;
	Faces m_faces;
	std::string m_FilePath;
	std::string m_Tag;
	std::vector<Vec3f> ThePositionVec; // T-Pose or static mesh
	std::vector<Vec3f> TheAnimationPositionVec; // Modifiable Mesh for animation
	std::vector<Vec3f> TheNormalVec;
	std::vector<Vec2f> TheUVVec;


	int m_Id;
	float m_MinX, m_MaxX;
	float m_MinY, m_MaxY;
	float m_MinZ, m_MaxZ;

};
#endif